package com.qf.controller;

import com.qf.entity.TbExam;
import com.qf.service.ExamService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 考试
 */
@RestController
@RequestMapping("/exam")
public class ExamController {

    @Autowired
    ExamService examService;

    @GetMapping("/findAll")
    public ResultMsg findAll(int page,int limit){
        return examService.findAllExam(page, limit);
    }

    @PostMapping("/addOrUpdata")
    public ResultMsg addOrUpdata(@RequestBody TbExam tbExam){
        return examService.addOrUpdataExam(tbExam);
    }

    @GetMapping("/delete")
    public ResultMsg delete(Integer examId){
        return examService.deleteExam(examId);
    }
}
